<template>
<div>
<el-button type="primary" @click="willAdd">添加</el-button>
<list-vue @willEdit="willEdit"></list-vue>
<form-vue :info="info" ref="form"></form-vue>
<el-pagination
      layout="prev, pager, next"
      :total="total"
      background
      :page-size="size"
      @current-change="changePage"
    >
    </el-pagination>
</div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import listVue from "./components/list.vue";
import formVue from "./components/form.vue";
import {toggle} from "../../mixins/mixins"; 
export default {
    components:{
        listVue,
        formVue
    },
props: [],
mixins:[toggle],
data() {return {}},
 computed: {
    ...mapGetters({
      list: "goods/list",
      total: "goods/total",
      size: "goods/size",
    }),
  },
  mounted() {
    this.reqList();
    this.reqTotal();
  },
  methods: {
    ...mapActions({
      reqList: "goods/reqList",
      reqTotal: "goods/reqTotal",
      changePage: "goods/changePage",
    }),
  }
};
</script>
<style scoped lang="less">
@import "../../less/index.less";
</style>